package transactionimplementation

import (
	abstracttransaction "salarypayment-case/AbstractTransaction"
	Database "salarypayment-case/DataBase"
	"salarypayment-case/Model"
	"salarypayment-case/modelimplementation"
)

type ChangeMemberTransaction struct {
	itsMemberId int
	itsDues     float64
	abstracttransaction.ChangeAffiliationTransaction
}

func (ct *ChangeMemberTransaction) RecordMembership(e *Model.Employee) {
	Database.PayrollDatabases.AddUnionMember(ct.itsMemberId, e)
}

func (ct *ChangeMemberTransaction) GetAffiliation() Model.Affiliation {
	return modelimplementation.CreateUnionAffiliation(ct.itsMemberId, ct.itsDues)
}
